#!/bin/bash

###
### Program: timemachine
### File:    tm-archive-quota.sh
### Version: 2.0
### Owner:   raptus ag
### Author:  Florian S.
### Purpose:
###
### Script for offiste-backup-servers to archive an quota in one step
###
###

#
# standard stuff
#

if ! test "$#" -eq 1
then
    echo "Usage: $0 <config-file>"
    exit 1
fi

SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
OLDDIR="`pwd`"
cd $SCRIPTPATH

CONFIGFILE="$1"
if ! test -f "$CONFIGFILE"
then
    echo "ERROR: Cannot find config file $CONFIGFILE"
    exit 1
fi

source "../config/defaults.conf"
source "$CONFIGFILE"
source "functions/logging.inc.sh"

#
# logfile stuff
#

log "======================================================================="
./tm-archiver.sh $CONFIGFILE
./tm-quota.sh stats $CONFIGFILE
log "======================================================================="

# eof
